PHP

How to convert hours, minutes, and seconds into several seconds in PHP | PHP programs

How to convert hours, minutes, and seconds into several seconds in PHP | PHP programs

How to convert hours, minutes, and seconds into several seconds in PHP | PHP programs

We will convert hours, minutes, and seconds into the number of seconds.

<?php

$hh = 1;
$mm = 48;
$ss = 50;

$seconds = $hh * 3600 + $mm * 60 + $ss;

print ("Number of seconds: " . $seconds);
?>
TutorialsLink Curator

This is an official account managed by the team TutorialsLink Community